package internal

import (
	"context"

	fpyDcsDb "gf/fpy/dcs/db"
)

func init() {
	fpyDcsDb.SetSoPath("./fpy/dcs/db/.so/db.so")
	fpyDcsDb.SetDbUrl("http://192.168.8.101:11001")
	fpyDcsDb.SetDbSid("0ao6")
}

type SysConfigDao struct {
	sid 	string
	dbSid   string
	projectSid 	string
	table   string
	group   string
	columns TSysConfigColumns
}

type TSysConfigColumns struct {
    Sid    string
    AddTime    string
    UpdateTime    string
    IsDel    string
    SiteName    string
    SeoTitle    string
    SeoKeywords    string
    SeoDescription    string
    FilingNo    string
    Address    string
    Tel    string
    Email    string
}


var cSysConfigColumns = TSysConfigColumns{
    Sid:    "sid",
    AddTime:    "add_time",
    UpdateTime:    "update_time",
    IsDel:    "is_del",
    SiteName:    "site_name",
    SeoTitle:    "seo_title",
    SeoKeywords:    "seo_keywords",
    SeoDescription:    "seo_description",
    FilingNo:    "filing_no",
    Address:    "address",
    Tel:    "tel",
    Email:    "email",
}

func NewSysConfigDao() *SysConfigDao {
	return &SysConfigDao{
		sid: 	"0apk",
		dbSid:	"0ao6",
		projectSid:	"dbd3",
		group:   "sys",
		table:   "config",
		columns: cSysConfigColumns,
	}
}

func (dao *SysConfigDao) Columns() TSysConfigColumns {
	return dao.columns
}

func (dao *SysConfigDao) Group() string {
	return dao.group
}

func (dao *SysConfigDao) Table() string {
	return dao.table
}

func (dao *SysConfigDao) Ctx(ctx context.Context) *fpyDcsDb.TDb {
	return fpyDcsDb.Ctx(ctx).Table(dao.sid).FpyProjectSid(dao.projectSid)
}